<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	String title = (String)request.getAttribute("titleName");
	if(title == null){
		title = "";
	}
	String description =  (String)request.getAttribute("description");
	if(description == null){
		description = "";
	}
	int auctionItemID = (Integer)request.getAttribute("auctionItemID");

	
	String errorColor = "color: red;";
	String titleErr = "";
	String descripErr = "";
	
	String borderErrorColor = "border-color: red;";
	String titleErrBorder = "";
	String descripErrBorder = "";
	
	String error = request.getParameter("error");
	if(error != null) {
		if(error.equals("titleLength")) { titleErr = errorColor; titleErrBorder = borderErrorColor;}
		else if(error.equals("descriptionLength")) { descripErr = errorColor; descripErrBorder = borderErrorColor;}
	}
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<table class="form">
	<tr><td class="label" style="<%=titleErr%>">Title:</td>			<td class="input"><input style="<%=titleErrBorder%>" type="text" id="name" value="<%=title%>"/></td></tr>
	<tr><td class="label">Image:</td>			<td class="input"><input type="file" id="image" id="file"/></td></tr>
	<tr><td class="label" style="<%=descripErr%>">Description:</td>		<td class="input"><textarea style="<%=descripErrBorder%>" id="description"><%=description%></textarea></td></tr>
	<tr><td class="label">&nbsp;</td>			<td class="submit"><input type="button" class="button" id="button" value="Edit" onclick="doEdit(<%=auctionItemID%>)"/></td></tr>
</table>

